Business Condiions & Forecasing Exponenial Smoohing LECTURE 2 MOVING AVERAGES AND EXPONENTIAL SMOOTHING OVERVIEW This lecure inroduces ime-series smoohing forecasing mehods. Various models are discussed, including mehods applicable o nonsaionary and seasonal ime-series daa. These models are viewed as classical ime-series model; all of hem are univariae. LEARNING OBJECTIVES Moving averages Forecasing using exponenial smoohing Accouning for daa rend using Hol's smoohing Accouning for daa seasonaliy using Winer's smoohing Adapive-response-rae single exponenial smoohing 1. Forecasing wih Moving Averages The naive mehod discussed in Lecure 1 uses he mos recen observaions o forecas fuure values. Tha is, ˆ + 1. Since he oucomes of are subjec o variaions, using he mean value is considered an alernaive mehod of forecasing. In order o keep forecass updaed, a simple moving-average mehod has been widely used. 1.1. The Model Moving averages are developed based on an average of weighed observaions, which ends o smooh ou shor-erm irregulariy in he daa series. They are useful if he daa series remains fairly seady over ime. Noaions ˆ +1 M - Moving average a ime, which is he forecas value a ime +1, - Observaion a ime, e ˆ - Forecas error. A moving average is obained by calculaing he mean for a specified se of values and hen using i o forecas he nex period. Tha is, M M ( 1 + n+ 1) + + n (1.1.1) 1 ( 1 2 + n) + + n (1.1.2)
Business Condiions & Forecasing Subracing Equaion (1.1.2) from Equaion (1.1.1), we obain: M M + ( n (1.1.3) 1 n) Equaion (1.1.3) allows us o updae he daa, making he forecasing process much easier. This equaion saes ha he moving average can be updaed by using a previous moving average plus he average changes in acual value from ime o -n. Using eiher Equaion (1.1.1) or (1.1.3) should yield he same resul. 1.2. A Numerical Example To illusrae how a moving average is used, consider Table 3-1, which conains he exchange rae beween he Japanese yen and he US dollar from 1983Q1 hrough 1998Q4. To calculae he hree-quarer moving average requires firs ha we sum he firs hree observaions (239.3, 239.8, and 236.1). This hree-quarer oal is hen divided by 3 o obained 238.40, as shown in he hird cell of column 4 in Table 1. This smoohed number, 238.40, becomes he forecas for 1983Q4, displayed in he fourh cell of column 5 of 3-Q MAF. By he same oken, we can obain he forecas for 1984Q1 by moving one quarer ahead and dropping he mos disan quarer. Tha is, ( + ) 2 3 (assume n 3), + 1 1 + 232 + 236.1+ 239.8 235.97. 3 The las value of he moving average is 130.29, which is he forecas for 1999.Q1. 115.2 + 135.72 + 139.95 130.29. 3 I is of ineres o calculae he squared errors (SE) and he sum of squared errors (SSE). The squared errors of using moving average are presened in column 8, labeled by SE_MA. The resuled mean-squared error (MSE) is 244.21 (The las row of Table 1). This figure (244.21) appears o be larger han he MSE of 218.94 obained by a naive model, he random-walk process. No surprisingly, if you are familiar wih he research in inernaional finance, his resul is consisen wih mos empirical findings. I has been shown ha no many models can bea he random-walk process since he curren exchange rae conains all he hisorical informaion perinen o predic exchange rae movemens, as saed by he efficien marke hypohesis. 2
Business Condiions & Forecasing Table 1. The Japanese en / US Dollar Rae: 1983Q1-1998Q4 Period Acual 1-Q RW 3-Q MA 3-Q MAF XS(α0.8) SE_RW SE_MA SE_XS Mar-83 239.3 Missing Missing Missing Missing Jun-83 239.8 239.3 Missing Missing 239.30 Sep-83 236.1 239.8 238.40 Missing 239.70 Dec-83 232 236.1 235.97 238.40 236.82 16.81 40.96 23.23 Mar-84 224.75 232 230.95 235.97 232.96 52.56 125.81 67.47 Jun-84 237.45 224.75 231.40 230.95 226.39 161.29 42.25 122.26 Sep-84 245.4 237.45 235.87 231.40 235.24 63.20 196.00 103.25 Dec-84 251.58 245.4 244.81 235.87 243.37 38.19 246.91 67.44 Mar-85 250.7 251.58 249.23 244.81 249.94 0.77 34.69 0.58 Jun-85 248.95 250.7 250.41 249.23 250.55 3.06 0.08 2.55 Sep-85 216 248.95 238.55 250.41 249.27 1085.70 1184.05 1106.86 Dec-85 200.6 216 221.85 238.55 222.65 237.16 1440.20 486.37 Mar-86 179.65 200.6 198.75 221.85 205.01 438.90 1780.84 643.17 Jun-86 163.95 179.65 181.40 198.75 184.72 246.49 1211.04 431.48 Sep-86 153.63 163.95 165.74 181.40 168.10 106.50 771.17 209.51 Dec-86 160.1 153.63 159.23 165.74 156.52 41.86 31.85 12.78 Mar-87 145.65 160.1 153.13 159.23 159.38 208.80 184.33 188.65 Jun-87 146.75 145.65 150.83 153.13 148.40 1.21 40.66 2.71 Sep-87 146.35 146.75 146.25 150.83 147.08 0.16 20.10 0.53 Dec-87 122 146.35 138.37 146.25 146.50 592.92 588.06 600.05 Mar-88 124.5 122 130.95 138.37 126.90 6.25 192.28 5.76 Jun-88 132.2 124.5 126.23 130.95 124.98 59.29 1.56 52.13 Sep-88 134.3 132.2 130.33 126.23 130.76 4.41 65.07 12.56 Dec-88 125.9 134.3 130.80 130.33 133.59 70.56 19.65 59.15 Mar-89 132.55 125.9 130.92 130.80 127.44 44.22 3.06 26.13 Jun-89 143.95 132.55 134.13 130.92 131.53 129.96 169.87 154.31 Sep-89 139.35 143.95 138.62 134.13 141.47 21.16 27.21 4.48 Dec-89 143.4 139.35 142.23 138.62 139.77 16.40 22.88 13.15 Mar-90 157.65 143.4 146.80 142.23 142.67 203.06 237.67 224.26 Jun-90 152.85 157.65 151.30 146.80 154.65 23.04 36.60 3.26 Sep-90 137.95 152.85 149.48 151.30 153.21 222.01 178.22 232.90 Dec-90 135.4 137.95 142.07 149.48 141.00 6.50 198.34 31.38 Mar-91 140.55 135.4 137.97 142.07 136.52 26.52 2.30 16.24 Jun-91 138.15 140.55 138.03 137.97 139.74 5.76 0.03 2.54 Sep-91 132.95 138.15 137.22 138.03 138.47 27.04 25.84 30.46 Dec-91 125.25 132.95 132.12 137.22 134.05 59.29 143.20 77.51 Mar-92 133.05 125.25 130.42 132.12 127.01 60.84 0.87 36.47 Jun-92 125.55 133.05 127.95 130.42 131.84 56.25 23.68 39.59 Sep-92 119.25 125.55 125.95 127.95 126.81 39.69 75.69 57.13 Dec-92 124.65 119.25 123.15 125.95 120.76 29.16 1.69 15.12 Mar-93 115.35 124.65 119.75 123.15 123.87 86.49 60.84 72.63 Jun-93 106.51 115.35 115.50 119.75 117.05 78.15 175.30 111.19 Sep-93 105.1 106.51 108.99 115.50 108.62 1.99 108.23 12.38 Dec-93 111.89 105.1 107.83 108.99 105.80 46.10 8.43 37.04 Mar-94 102.8 111.89 106.60 107.83 110.67 82.63 25.33 61.98 Jun-94 98.95 102.8 104.55 106.60 104.37 14.82 58.47 29.43 Sep-94 98.59 98.95 100.11 104.55 100.03 0.13 35.48 2.09 Dec-94 99.83 98.59 99.12 100.11 98.88 1.54 0.08 0.90 Mar-95 88.38 99.83 95.60 99.12 99.64 131.10 115.42 126.78 Jun-95 84.77 88.38 90.99 95.60 90.63 13.03 117.29 34.36 Sep-95 98.18 84.77 90.44 90.99 85.94 179.83 51.65 149.76 Dec-95 102.91 98.18 95.29 90.44 95.73 22.37 155.42 51.52 (coninued) 3
Business Condiions & Forecasing Table 3-1 (coninued) Period Acual 1-Q RW 3-Q MA 3-Q MAF XS(α0.8) SE_RW SE_MA SE_XS Mar-96 106.49 102.91 102.53 95.29 101.47 12.82 125.51 25.16 Jun-96 109.88 106.49 106.43 102.53 105.49 11.49 54.07 19.30 Sep-96 111.45 109.88 109.27 106.43 109.00 2.46 25.23 6.00 Dec-96 115.98 111.45 112.44 109.27 110.96 20.52 44.98 25.20 Mar-97 123.97 115.98 117.13 112.44 114.98 63.84 133.02 80.89 Jun-97 114.3 123.97 118.08 117.13 122.17 93.51 8.03 61.96 Sep-97 121.44 114.3 119.90 118.08 115.87 50.98 11.27 30.98 Dec-97 129.92 121.44 121.89 119.90 120.33 71.91 100.33 92.03 Mar-98 133.39 129.92 128.25 121.89 128.00 12.04 132.33 29.04 Jun-98 139.95 133.39 134.42 128.25 132.31 43.03 136.89 58.33 Sep-98 135.72 139.95 136.35 134.42 138.42 17.89 1.69 7.30 Dec-98 115.2 135.72 130.29 136.35 136.26 421.07 447.46 443.54 Mar-99 115.2 Missing 130.29 119.41 MSE 218.94 244.21 233.39 Noes: 1-Q RW: 1-quarer random walk process 3-Q MA : 3-quarer moving average 3-Q MAF: 3-quarer moving average forecas XS(α0.8): 1-quarer exponenial smoohing wih α 0.8 SE_RW: Squared errors by using random walk forecas SE_MA: Squared errors by 3-quarer moving-average forecas SE_XS: Squared errors by using exponenial-smoohing forecas MSE: Mean squared errors 1.3. Remarks on Moving-Average Mehod The moving-average mehod provides an efficien mechanism for obaining a value for forecasing saionary ime series. The echnique is simply an arihmeic average as ime passes, wih some lag-lengh deermined opimally by an underlying cycle presen in he daa. Thus, moving-averages and moving-average lines are frequenly derived by echnicians on Wall Sree o generae marke expecaions, one of he mos imporan inpu variables used by fund managers o allocae porfolios. The difficuly in using moving averages is heir inabiliy o capure he peaks and roughs of he series. When he marke (acual) daa are moving down persisenly, he moving average forecas ends o produce over-prediced valued; while when he marke is moving up coninually, he moving-average forecas will under-predic he marke. Obviously, his mehod fails o deal wih non-saionary daa. Moreover, since all he daa poins in he moving-average process are given equal weigh, his approach fails o reflec he imporance of ime ordering wih respec o observaions. For his reason, a weighed moving-average mehod has been suggesed. I merely imposes differen weighs on he observaions being used for forecasing. The double moving-average mehod, aking he form of moving average on he firs moving-averages, gives more weigh on he middle poin. Exponenial smoohing mehods are he echniques ha place more weighs on he recen observaions. 4
Business Condiions & Forecasing 2. Forecasing wih Exponenial Smoohing 2.1. The Model Simple exponenial smoohing akes he form of: F+1 α + ( 1 α) F (2.1.1) ˆ+1 α + ( 1 α) ˆ Noaions: F forecas value for period +1 made a ime, which can be defined as 1 +1 acual value in period (Wilson and Keaing use X, ohers use Z, we use o mainain noaion consisency) F forecas value for period made by -1. α smoohing consan (0< α <1) ˆ + By coninuing o subsiue previous forecasing values back o he saring poin of he daa: (2.1.2) Wriing his equaion in compac form: ˆ +1 1 k α ( 1 α) + (1 α) 0 k 0 k (2.1.3) ˆ+1 + ˆ + ) 2 ˆ 1 α α( 1 α) α(1-α 1 + + α( 1 α) 1 + (1 α) 0 2 I is clear ha he weighs, α, α(1 α), α(1-α), on, 1, 2 as implied in Equaion (2.1.3) are exponenially declining. Two poins deserve our aenion before we proceed o make our forecass. Firs, we need o decide he iniial value, 0. A convenien way o accomplish his is o uilize he value of he iniial daa poin or he average value of he firs few observaions of he daa series. Second, we mus deermine he value of α. Usually, his selecion can be achieved by minimizing he MSE or RMSE based on in-sample experimens. 5
Business Condiions & Forecasing 2.2. Numerical Example Simple exponenial smoohing can be illusraed by using quarerly daa of he yen/dollar exchange rae in Table 3-1. Assuming ha α 0.8, calculaions of he exponenial smoohing of he exchange rae are as follows: F+1 α + ( 1 α) F 0.8(239.8) + (1-0.8) 239.30 239.70 - Forecas for 1983.Q3, 0.8(236.1) + (1-0.8) 239.70 236.82 - Forecas for 1983.Q4. By calculaing he smoohing values in he same manner, we obain he figures presened in column 6 under XS(α 0.8). Again, he squared errors are shown in column 9; he resuling MSE is sill higher han he random-walk process alhough i is slighly beer han he moving-average smoohing calculaion. From our exercise, he naive model in he form of a random walk is no so naive; i is quie appropriae o describe an asse-price behavior. As a guide for selecing he smoohing consan, i is suggesed ha α values close o 0 are seleced if he series has small variaions and values close o 1 are seleced if he forecas values appear o depend on recen changes in acual values. Usually he MSE or RMSR can be used as he crierion for selecing an appropriae smoohing consan. For insance, by assigning α values from 0.1 o 0.99, we selec he value ha produces he smalles MSE. 2.3. Remarks on Simple Exponenial Smoohing The model ˆ+1 α + ( 1 α) ˆ can be rewrien as: ˆ + ˆ 1 α ( ˆ ), change in forecasing value is proporionae o he forecas error. Tha is, ˆ ˆ α ε ). 1 + ( Exponenial smoohing provides an effecive mechanism for forecasing, especially when we have only a few observaions in hand for conducing he forecas process. This mehod is appropriae for series ha move randomly above and below a consan mean. However, if he series presens a rend or seasonal paern, some modificaion is required. 3. Exponenial Smoohing wih Trend - Hol s Model Hol's wo-parameer exponenial smoohing model exends simple exponenial smoohing o include a linear-rend componen. Accordingly, Hol's model is appropriae for nonsaionary daa. We shall briefly presen he model below: 6
Business Condiions & Forecasing 3.1. The Hol s Model F α + 1 α)( F + T ) (3.1.1) +1 ( T+1 β ( F + 1 F ) + (1 β ) T (3.1.2) H F 1 mt + 1 (3.1.3) +m + + Noaions: F forecas value for period +1 made a ime, which can be denoed as 1 +1 acual value in period F forecas value for period made by -1. T rend α smoohing consan for he daa (0< α <1) β smoohing consan for he rend esimae (0< β <1) m number of periods ahead o be forecas ˆ + H +m Hol s forecas value of period +m. The model proposed by Hol conains wo smoohing consans, one for he level of he series, and one for he rend. In equaion (3.1.1), he smoohing value, F + 1, is prediced based on he curren observaion and he previous smoohed value. However, he laer is adjused by adding a rend facor. The rend in equaion (3.1.2) evolves by weighing he average of he recen change of he smoohed value and he previous rend. Equaion (3.1.3) is a forecas equaion which is used o forecas m periods ino he fuure by using boh updaed smoohing value, F + 1, and rend esimae, T, derived from Equaions (3.1.1) and (3.1.2). To conduc forecass in his model m periods ahead, we can follow he same procedure as ha of simple exponenial-smoohing model. Wha we have o add here is a rend variable. The iniial rend value is usually se a 0; he incremen is advanced by 1 over ime. Here, we need o search for wo smoohing consans, α and β by using MSE or RMSE crierion. 4. Winers Exponenial Smoohing Due o he fac ha previous models ignored he seasonal componen, Winers hreeparameer, exponenial-smoohing model exends Hol s model by adding a seasonaliy facor, which is iself smoohed. Accordingly, we have hree smoohing parameers, one for 7
Business Condiions & Forecasing acual daa, one for rend, and one for seasonal facors. Since a new variable is added o he sysem, here are four equaions in Winers model. 4.1. The Winers Model F α / S ) (1 α)( F T ) (4.1.1) ( p + 1 + 1 S γ ( / F ) + (1 γ ) S (4.1.2) p T β ( F F 1 ) + (1 β ) T 1 (4.1.3) W+m ( F + mt ) S (4.1.4) + m p Noaions: F smoohed value of he level of series for period F 1 smoohed value for period -1 acual value in period T rend esimae S seasonaliy esimae α smoohing consan for he daa (0< α <1) β smoohing consan for he rend esimae (0< β <1) γ smoohing consan for seasonaliy esimae (0<γ <1) p number of periods in seasonal cycle m number of periods ahead o be forecas W+m Winers forecas for m periods ino he fuure A special feaure of his model is ha he elemen of a seasonal facor is added o he model. Equaion (4.1.1) is similar o Hol s equaion for smoohing he rend. A minor difference is ha seasonal flucuaions in have been removed. As can be seen in he firs erm, is divided by S p o adjus for seasonaliy. The seasonaliy esimae and rend are updaed in a fashion similar o he simple exponenial process as described Equaions (4.1.2) and (4.1.3). Finally, Equaion (4.1.4) is employed o compue he forecas for m periods ino he fuure. 8
Business Condiions & Forecasing 5. Adapive-Response Approach An alernaive o simple exponenial smoohing for saionary and non-seasonal ime series is he adapive-response approach o single exponenial smoohing model in which an adapive algorihm is used o deermine a ime-varying smoohing parameer. Accordingly, adapive smoohing has he abiliy o adap o a changing mean of an oherwise saionary and nonseasonal ime series. 5.1. The Adapive-Response model F+1 α + ( 1 α ) F (5.1.1) S α (5.1.2) A S A e + ( 1 β ) S 1 β (5.1.3) β β (5.1.4) e + ( 1 ) A 1 e F (5.1.5) The basic equaion (5.1.1) for forecasing is generally he same as he simple exponenial smoohing model represened by equaion (2.1.1). The only difference is ha he smoohed erm α in Equaion (2.1.1) is replaced by α, and he laer is adapive over ime, governed by he value of he smoohed error divided by he absolue smoohed error as expressed by Equaion (5.1.2). Like mos exponenial smoohing models, boh S (no a noaion for seasonaliy) and A are smoohed ou by using Equaions (5.1.3) and (5.1.4). The forecasing procedure for his model can be proceeded recursively. Given he values of and F, we can esimae e from (5.1.5). The e hen is plugged ino (5.1.3) and (5.1.4). Given he esimaed value of β, we can obain α by using (5.1.2). Finally, we use α, and F o predic F +1 by employing equaion (5.1.1). 5.2 Remarks The advanage of his model is ha i allows he smoohing value o change over ime. However, he underlying raionale for ime varying is less clear. If we wan o have a imevarying coefficien model o reflec he changing paern, he behavior of α can be specified as a random coefficien or auoregressive form, depending on he naure of he process. Anoher drawback for his model is ha here is no explici way o handle seasonaliy. Thus, in facing seasonal daa, he daa mus firs be deseasonalized and hen reseasonalized o 9
Business Condiions & Forecasing generae forecass. Adapive smoohing is an alernaive o Winers' smoohing when handling seasonal ime series. A major flaw wih smoohing models is heir inabiliy o predic cyclical reversals in he daa, since forecass depend solely on he pas. Perhaps even more pernicious is he possibiliy of spurious cycles, since all smoohing models produce serially correlaed forecass. Threaded quesion Assume you were o use α values of 0.1, 0.5, and 0.95 in a simple exponenial smoohing model. How would hese differen α values weigh pas observaions of he variable o be forecased? How would you know which of hese α values provides he bes forecasing model? If he α 0.99 value provides he bes forecas for your daa a he curren calculaion, would his imply ha you should make forecass in he fuure based on availabiliy of new daa? Does exponenial smoohing place more or less weigh on he mos recen daa when compared wih he moving-average mehod? Wha weigh is applied o each observaion in a moving-average model? Why is smoohing (simple, Hol's, and Winers') also ermed exponenial smoohing? Assignmen Consider he monhly sock index daa for he US (USsp) marke from 1995.01-2000.06 available o he class. Use Excel o calculae boh he 12-monh moving-average and simple exponenial smoohing (α 0.6) for hese daa and compare he forecass of hese wo mehods by calculaing he roo-mean-squared errors. Make brief commens on your findings. (Noe he daa file is: Monhly_US_JP_MacroDaa and variable name is USsp). 10